/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package CTR;

import DBL.IFDBFaktura;
import DBL.DBFaktura;
import MDL.*;
import CTR.*;
/**
 *
 * @author Niklas
 */
public class FakturaCTR
{
    private IFDBFaktura dbFaktura;
    private Faktura faktura;
    private salgCTR salgCTR;

    public FakturaCTR()
    {
        salgCTR = new salgCTR();
        dbFaktura = new DBFaktura();
    }

    public void createFaktura(int fakturaId, String betalingsdato, int antal, int fakturaNr)
    {
        //dbInvoice = new DBInvoice();
        faktura = new Faktura( fakturaId,  betalingsdato,  antal, fakturaNr);

        dbFaktura.createFaktura(faktura);
    }

    public String printFaktura(int ordreId)
    {
        Ordre ordre;
        String printBuild ="";
        ordre = salgCTR.findOrdre(ordreId);

        printBuild +="SalgsNr: \n";
        printBuild +=ordre.getOrdreId()+"\n";
        printBuild +="Antal der skal betales for: \n";
        printBuild +=ordre.getPris()+"\n";

        return printBuild;
    }



}
